import re
import os

input_dir = "E:\\workspace\\PassAccountingOneWeek"
for file_name in os.listdir(input_dir):
    print file_name
    match = re.search("PassAccountingOneWeek-(.*).apk", file_name)
    website_folder = input_dir + "\\website"
    if match is not None:
        extract = match.group(1)
        new_file = "" + extract + ".apk"
        dest_path = input_dir + '\\' + extract;
        if not os.path.exists(dest_path):
            os.makedirs(dest_path)
        if not os.path.exists(website_folder):
            os.makedirs(website_folder)
        print input_dir;
        print dest_path;
        os.rename(os.path.join(input_dir,file_name),os.path.join(dest_path ,"PassAccountingOneWeek.apk"))
        print website_folder
        print "PassAccountingOneWeek-" + extract + ".apk"
        #os.rename(os.path.join(input_dir,file_name),os.path.join(website_folder, "PassAccountingOneWeek-" + extract + ".apk"))

        
    
